<!-- $Id: goods_inquiry_info.htm wonder $ -->
{include file="pageheader.htm"}
<div class="main-div">
<form method="post" action="goods_inquiry.php" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">

    <script type="text/javascript">
          var arr = new Array();
          var sel_filter_attr = "请选择品牌...";
          {foreach from=$cat_brand_list item=val key=att_cat_id}
            arr[{$att_cat_id}] = new Array();
            {foreach from=$val item=item key=i}
              {foreach from=$item item=attr_val key=attr_id}
                arr[{$att_cat_id}][{$i}] = ["{$attr_val}", {$attr_id}];
              {/foreach}
            {/foreach}
          {/foreach}

          function changeCat(obj, target_id)
          {
            var key = obj.value;
            var sel = document.getElementById(target_id); //window.ActiveXObject ? obj.parentNode.childNodes[4] : obj.parentNode.childNodes[5];
            sel.length = 0;
            sel.options[0] = new Option(sel_filter_attr, 0);
            if (arr[key] == undefined)
            {
              return;
            }
            for (var i= 0; i < arr[key].length ;i++ )
            {
              //sel.options[i+1] = new Option(arr[key][i][0], arr[key][i][1]);
              sel.options[i+1] = new Option(arr[key][i][0], arr[key][i][0]);
            }

          }

          </script>
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label" width="80%">商品名称</td>
    <td>
    {if $entity.goods_name eq ''}
    <input type="text" name="goods_name" maxlength="60" size="40" />{$lang.require_field}
    {else}
    {$entity.goods_name|escape:html}
    {/if}
    </td>
  </tr>
  <tr>
    <td class="label">国家</td>
    <td>
    {if $entity.nation eq ''}
 	<select name="nation" id="nation" onChange="changeCat(this, 'brand_name')"><option value="">请选择国家...</option>{$cat_list}</select>{$lang.require_field}
    {else}
    {$entity.nation|escape:html}
    {/if}    
    </td>
  </tr>
  <tr>
    <td class="label">品牌</td>
    <td>
    {if $entity.brand_name eq ''}
    <select name="brand_name" id="brand_name"><option value="">请选择品牌...</option></select>{$lang.require_field}
    {else}
    {$entity.brand_name|escape:html}
    <input type="hidden" name="brand_name" value="{$entity.brand_name|escape:html}" />
    {/if}    
    </td>
  </tr>
  <tr>
    <td class="label">规格</td>
    <td>
    {if $entity.specification eq ''}
    <input type="text" name="specification" maxlength="60" size="40" />{$lang.require_field}
    {else}
    {$entity.specification|escape:html}
    {/if}    </td>
  </tr>
  <tr>
    <td class="label">型号</td>
    <td>
    {if $entity.model eq ''}
    <input type="text" name="model" maxlength="60" size="40" />{$lang.require_field}
    {else}
    {$entity.model|escape:html}
    {/if}    </td>
  </tr>
  <tr>
    <td class="label">订货码</td>
    <td>
    {if $entity.order_code eq ''}
    <input type="text" name="order_code" maxlength="60" size="40" />{$lang.require_field}
    {else}
    {$entity.order_code|escape:html}
    {/if}    </td>
  </tr>
  <tr>
    <td class="label">物料类型</td>
    <td>
    {if $entity.materials_type eq ''}
    <input type="text" name="materials_type" maxlength="60" size="40" />{$lang.require_field}
    {else}
    {$entity.materials_type|escape:html}
    {/if}
    </td>
  </tr>
  <tr>
    <td class="label">历史不税价</td>
    <td>
    {if $history_query eq 'history_query'}
    {$entity.no_tax_price}
    {else}
    <input type="text" name="no_tax_price" maxlength="60" size="40" value="{$entity.no_tax_price}" />{$lang.require_field}
    {/if}    
    </td>
  </tr>
  {if $entity.update_time neq ''}
  <tr>
    <td class="label">报价时间</td>
    <td>{$entity.update_time}</td>
  </tr>  
  {/if}
  <tr>
    <td colspan="2" align="center"><br />
{if $history_query eq 'history_query'}
	<input type="button" class="button" value=" 返回 " onclick="history.back();" />
{else}
      <input type="submit" class="button" value="{$lang.button_submit}" />
      <input type="reset" class="button" value="{$lang.button_reset}" />
      <input type="hidden" name="act" value="{$form_action}" />
      <input type="hidden" name="id" value="{$entity.id}" />
{/if}        
    </td>
  </tr>
</table>
</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--
document.forms['theForm'].elements['goods_name'].focus();
onload = function()
{
    // 开始检查订单
    startCheckOrder();
}
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    
{if $entity.goods_name eq ''}
    validator.required("goods_name",    goods_name_msg);
    validator.required("nation",    nation_msg);
    validator.required("brand_name",    brand_name_msg);
    validator.required("specification",    specification_msg);
    validator.required("model",    model_msg);
    validator.required("order_code",    order_code_msg);
    validator.required("materials_type",    materials_type_msg);
{/if}     
    validator.isNumber("no_tax_price", no_tax_price_msg, true);
    
    return validator.passed();
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}